home *** CD-ROM | disk | FTP | other *** search
- /*
- * Common include file
- *
- * Jwahar Bammi
- * usenet: cwruecmp!bammi@decvax.UUCP
- * csnet: bammi@cwru.edu
- * arpa: bammi@cwru.edu
- * CompuServe: 71515,155
- */
-
- #include <stdio.h>
- #include <ctype.h>
- #include <setjmp.h>
- #include <osbind.h>
- #include "decl.h"
-
- /* See configurable parameters towards the end of the file */
- /* Leave the rest alone */
-
-
-
- /* Common defines */
- #ifndef FALSE
- #define FALSE 0
- #define TRUE 1
- #endif
-
-
- #define EscSeq(x) Bconout(2,(int)'\033'); Bconout(2,(int)x) /* Send Esc.
- Seq. to console */
- #define CTRL(X) (X & 037) /* CTRL-anything */
-
- #define STOS "GEMDOS/TOS"
- #define ZMDMVERSION "1.2 -- 07/25/87"
-
- #define IBUFSIZ 16*1024 /* Size of my Rs232 receive buffer */
-
- /* Ward Christensen / CP/M parameters - Don't change these! */
- #define ENQ 005
- #define CAN ('X'&037)
- #define XOFF ('s'&037)
- #define XON ('q'&037)
- #define SOH 1
- #define STX 2
- #define EOT 4
- #define ACK 6
- #define NAK 025
- #define CPMEOF 032
- #define WANTCRC 0103 /* send C not NAK to get crc not checksum */
- #define TIMEOUT (-2)
- #define RCDO (-3)
- #define ERRORMAX 5
- #define RETRYMAX 10 /* for dogs like compuserve */
- #define WCEOT (-10)
- #define SECSIZ 128 /* cp/m's Magic Number record size */
- #define PATHLEN 128 /* ready for 4.2 bsd ? noooooo */
- #define KSIZE 1024 /* record size with k option */
- #define UNIXFILE 0x8000 /* happens to the the S_IFREG file mask bit for stat */
- #define DEFBYTL 2000000000L /* default rx file size */
- #define WANTG 0107 /* Send G not NAK to get nonstop batch xmsn */
-
- #define PURGELINE while(Bconstat(1))Bconin(1);Lleft = 0
-
- #define RLOGFILE "rzlog"
- #define zperr vfile
- #define zperr2 vfile2
-
- #define OK 0
- #define ERROR (-1)
- #define HOWMANY 133
- /* Parameters for ZSINIT frame */
- #define ZATTNLEN 32 /* Max length of attention string */
-
-
- /* Types */
-
- #ifdef LONG
- #undef LONG /* Get rid of stupid portab.h definition */
- #endif
-
- #ifdef WORD
- #undef WORD
- #endif
-
- #ifdef UWORD
- #undef UWORD
- #endif
-
- struct stat
- {
- char st_sp1[21]; /* Junk */
- char st_mode; /* File attributes */
- int st_time; /* Mod Time */
- int st_date; /* Mod date */
- long st_size; /* File size */
- char st_name[14]; /* File name */
- };
-
- /* The structure returned by Iorec(), really ptr to this type */
- typedef struct {
- char *ibuf;
- int ibufsiz;
- int ibufhd;
- int ibuftl;
- int ibuflow;
- int ibufhi;
- } IOREC;
-
- /*
- * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell.
- * NOTE: First srgument must be in range 0 to 255.
- * Second argument is referenced twice.
- *
- * Programmers may incorporate any or all code into their programs,
- * giving proper credit within the source. Publication of the
- * source routines is permitted so long as proper credit is given
- * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg,
- * Omen Technology.
- */
- #ifndef IN_COMMON
- extern unsigned int crctab[]; /* see definition in common.c */
- extern unsigned long int crc_32_tab[]; /* see definition in common.c */
- #endif
-
- #define updcrc(cp, crc) \
- ( crctab[(((unsigned int)crc >> 8) & 255)] ^ ((unsigned int)crc << 8) ^ (unsigned int)cp)
-
- #define UPDC32(octet, crc) \
- (crc_32_tab[(((unsigned long)crc) ^ ((unsigned long)octet)) & 0xff] ^ (((unsigned long)crc) >> 8))
-
-
- /*****************************************************************************\
- * *
- * CONFIGURABLE STUFF BEGINS HERE *
- * *
- \*****************************************************************************/
-
-
-
- /*****************************************************************************\
- * *
- * Set up the following to satisfy your personal fancies *
- * *
- \*****************************************************************************/
-
-
- /* ------------------------------------------------------------------------*/
- /* Uncomment one of the following */
-
- #define BAUD_DEFAULT 1 /* for 9600 Baud - see rsconf() */
- #define BAUD_STRING "9600" /* String for Baud rate */
- #define BAUD_RATE 9600 /* the integer */
-
- /* #define BAUD_DEFAULT 7 */ /* for 1200 Baud - see rsconf() */
- /* #define BAUD_STRING "1200" */ /* String for Baud rate */
- /* #define BAUD_RATE 1200 */ /* the integer */
-
- /* ------------------------------------------------------------------------*/
-
- /*
- * Do flow control while doing terminal emulation -
- * this only needs to be defined if you are
- * going to be running Zmdm at 19200 Baud and
- * you are going to be sending it (from the host)
- * greater that 16k characters in one blast, without
- * any pause whatsoever. For 99.95 % of us mortals
- * this will never be required. Even if it is defined
- * its no big deal, as flow control will not happen
- * unless the condition described above exists.
- * NOTE: flow control is turned off during file transfers.
- */
- /* #define FLOW_CTRL 1 */ /* do flow control */
-
- #define BBUFSIZ 32768L /* Size of file/capture buffer */
-
- /*****************************************************************************\
- * *
- * End of configurable parameters *
- * *
- \*****************************************************************************/
-
- /** EOF **/
-